<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        html,
        body {
            height: 100%;
        }

        #app {
            height: 100%;
            position: relative;
            background-color: rgba(0, 0, 0, .4);
        }

        .shopcart {
            position: fixed;
            bottom: 0;
            background-color: #fff;
            width: 100%;
            padding: 10px;
            box-sizing: border-box;
        }

        .shopcart .btns {
            display: flex;
            justify-content: space-between;
        }

        .shopcart .list .good {
            display: flex;
            margin: 10px 0;
        }

        .imgbox {
            width: 100px;
            margin-right: 10px;
        }

        .imgbox img {
            width: 100%;
        }

        .list .good .text {
            flex: 1;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
        }

        .list .good .text .name {
            font-weight: bolder;
        }

        .list .good .text .price {
            display: flex;
            justify-content: space-between;
        }

        .list .good .text .price .money {
            color: orangered;
        }

        .list .good .text .price span:nth-child(1) {
            display: inline-block;
            width: 14px;
            height: 14px;
            text-align: center;
            line-height: 14px;
            border: 2px solid lightskyblue;
            color: lightskyblue;
            border-radius: 50%;
            cursor: pointer;
        }

        .list .good .text .price span:nth-child(3) {
            display: inline-block;
            width: 14px;
            height: 14px;
            text-align: center;
            line-height: 14px;
            border: 2px solid lightskyblue;
            color: #fff;
            background-color: lightskyblue;
            border-radius: 50%;
            cursor: pointer;
        }

        .empty {
            padding: 50px;
            text-align: center;
            ;
        }
    </style>
</head>

<body>
    <div id="app">
        <div class="shopcart">
            <div class="btns">
                <span @click="mysort(index)" v-for="(item ,index) in btnArr" :key="index">{{item}}</span>
            </div>
            <div v-if="list.length != 0" class="list">
                <div v-for="(item,index) in list" :key="index" class="good">
                    <div class="imgbox">
                        <img :src="item.pic" alt="">
                    </div>
                    <div class="text">
                        <div class="name">{{item.name}}</div>
                        <div class="price">
                            <div class="money">￥{{item.price}}</div>
                            <div>
                                <span @click="sub(item)">-</span>
                                <span>{{item.count}}</span>
                                <span @click="add(item)">+</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script src="./vue-2.5.21.js"></script>
    <script src="./02.数组排序.js"></script>
</body>

</html>